export const validEmail = async (_rule, value) => {
  const reg = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/
  if (!value) {
    return Promise.reject('Please Enter Your Email Address!')
  } else if (!reg.test(value)) {
    return Promise.reject('Please Enter a Valid Email Address!')
  } else {
    return Promise.resolve()
  }
}

export const validPwd = async (_rule, value) => {
  if (!value) {
    return Promise.reject('Please Enter Your Password!')
  } else {
    return Promise.resolve()
  }
}

export const validOrderNumber = async (_rule, value) => {
  if (!value) {
    return Promise.reject('Please Enter Your Order Number!')
  } else {
    return Promise.resolve()
  }
}

export const validNull = async (_rule, value) => {
  if (!value) {
    return Promise.reject('Please Enter Your Info!')
  } else {
    return Promise.resolve()
  }
}
